from rest_framework import serializers
from django.contrib.auth.models import Permission,ContentType,Group

#1,操作权限序列化器
class PermissionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Permission
        fields = "__all__"

#2,获取权限类型序列化器
class PermissionContentTypeSerializer(serializers.ModelSerializer):
    class Meta:
        model = ContentType
        fields = ("id","name") #name是来至于@property装饰的方法